Skip to content

NextJSVite: Add @opentelemetry/api to optimizeDeps#33577

Merged
ndelangen merged 1 commit into
nextfrom
norbert/add-extra-optimizeDeps-nextjs-vite
Jan 19, 2026
Merged

NextJSVite: Add @opentelemetry/api to optimizeDeps#33577
ndelangen merged 1 commit into
nextfrom
norbert/add-extra-optimizeDeps-nextjs-vite

Conversation

@ndelangen

@ndelangen ndelangen commented Jan 19, 2026

Copy link
Copy Markdown
Member

What I did

I noticed this in CI:

 RUN  v4.0.17 /tmp/storybook-sandboxes/nextjs-vite-default-ts

8:55:57 AM [vite] (client) Forced re-optimization of dependencies
8:56:03 AM [vite] (client) ✨ new dependencies optimized: @opentelemetry/api
8:56:03 AM [vite] (client) ✨ optimized dependencies changed. reloading

[vitest] Vite unexpectedly reloaded a test. This may cause tests to fail, lead to flaky behaviour or duplicated test runs.
For a stable experience, please add mentioned dependencies to your config's `optimizeDeps.include` field manually.

See:
https://app.circleci.com/pipelines/github/storybookjs/storybook/113135/workflows/285df6d8-0fa1-4574-924a-582a9eaf097d/jobs/1019175

And I'm hoping adding an entry to optimizeDeps will resolve this.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

Caution

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Chores
    • Optimized dependency handling for Storybook's Next.js Vite integration to improve build performance.

✏️ Tip: You can customize this high-level summary in your review settings.

@ndelangen ndelangen self-assigned this Jan 19, 2026
@ndelangen ndelangen added bug nextjs builder-vite ci:normal Run our default set of CI jobs (choose this for most PRs). labels Jan 19, 2026
@ndelangen ndelangen changed the title Add '@opentelemetry/api' to Vite dependencies in preset.ts NextJSVite: Add '@opentelemetry/api' to optimizeDeps Jan 19, 2026
@nx-cloud

nx-cloud Bot commented Jan 19, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit c8d2ee4

Command Status Duration Result
nx run-many -t compile,check,knip,test,pretty-d... ✅ Succeeded 7m 10s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-19 09:32:49 UTC

@ndelangen ndelangen changed the title NextJSVite: Add '@opentelemetry/api' to optimizeDeps NextJSVite: Add @opentelemetry/api to optimizeDeps Jan 19, 2026
@ndelangen ndelangen marked this pull request as ready for review January 19, 2026 09:29
@coderabbitai

coderabbitai Bot commented Jan 19, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Added '@opentelemetry/api' to the optimizeViteDeps array in the Next.js Vite preset configuration. This extends the set of dependencies that Vite optimizes for the Storybook Next.js integration.

Changes

Cohort / File(s) Summary
Dependency Optimization Configuration
code/frameworks/nextjs-vite/src/preset.ts
Added '@opentelemetry/api' to the optimizeViteDeps array for Vite dependency optimization

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@storybook-app-bot

Copy link
Copy Markdown

Package Benchmarks

Commit: c8d2ee4, ran on 19 January 2026 at 09:33:41 UTC

The following packages have significant changes to their size or dependencies:

@storybook/react-native-web-vite

Before After Difference
Dependency count 159 159 0
Self size 30 KB 30 KB 🎉 -10 B 🎉
Dependency size 23.00 MB 23.12 MB 🚨 +115 KB 🚨
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 183 183 0
Self size 775 KB 775 KB 🚨 +55 B 🚨
Dependency size 67.38 MB 67.45 MB 🚨 +73 KB 🚨
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 176 176 0
Self size 30 KB 30 KB 🎉 -40 B 🎉
Dependency size 65.95 MB 66.03 MB 🚨 +73 KB 🚨
Bundle Size Analyzer Link Link

@ndelangen ndelangen merged commit f06fa2f into next Jan 19, 2026
133 of 138 checks passed
@ndelangen ndelangen deleted the norbert/add-extra-optimizeDeps-nextjs-vite branch January 19, 2026 09:42
@github-actions github-actions Bot mentioned this pull request Jan 19, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug builder-vite ci:normal Run our default set of CI jobs (choose this for most PRs). nextjs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant